package br.com.diego.system.controller.cadastropermissao;

import br.com.diego.system.entity.permissao.Permissao;
import br.com.diego.system.manager.permissao.PermissaoManager;
import org.springframework.beans.factory.annotation.Autowired;

public class CadastroPermissaoFactory {

    @Autowired
    private PermissaoManager permissaoManager;

    public PermissaoVo buscarPeloId(Long id) {    
        
        Permissao permissao = permissaoManager.buscarPeloId(id);        
        if (permissao != null) {
                PermissaoVo permissaoVo = new PermissaoVo(permissao);                
            return permissaoVo;
        } else {
            return null;
        }
    }
}
